package boun.center;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.animation.Animation;
import android.view.animation.Animation.AnimationListener;
import android.view.animation.AnimationUtils;

public class SplashScreen extends Activity {
	
	@Override
	public void onCreate(Bundle savedInstanceState){
		super.onCreate(savedInstanceState);
		setContentView(R.layout.splash);
		
		final View l = (View)findViewById(R.id.splashh);
		System.out.println(l);
		Animation a = AnimationUtils.loadAnimation(SplashScreen.this, android.R.anim.fade_out);
		a.setDuration(2000);
		a.setRepeatCount(0);
		a.setAnimationListener(new AnimationListener(){
			@Override
			public void onAnimationEnd(Animation arg0) {
				l.setVisibility(View.GONE);
				Intent intent = new Intent(SplashScreen.this,TabMenu.class);
				startActivity(intent);
				finish();
			}

			@Override
			public void onAnimationRepeat(Animation animation) {
				// TODO Auto-generated method stub
				
			}

			@Override
			public void onAnimationStart(Animation animation) {
				// TODO Auto-generated method stub
				
			}
			
		});
		
		l.startAnimation(a);		
	}
}
